package com_djm_2025_05_10;

/**
 * 用于展示Java的自动类型转换
 *
 * @author dengjiangming
 * @date 2025-05-11
 * @version 1.0.0
 */
public class CastDemo1 {

    public static void main(String[] args) {

        //int赋值给long的时候，自动转化为long
        int num = 10;
        long longNum = 20;
        longNum = num;


//        num = longNum;

        System.out.println(longNum);
        System.out.println(num);

        float numf = 2.0f;
        double d = numf;
        System.out.println(d);

//        numf = d;

        short a = 10;
        short b = 20;
//        short c = a+b;

//        System.out.println(a+b);

    }
}
